Skip to content

GH-49269: [Python][Docs] Add code examples for compute function first/last/first_last#49270

Open
zhengruifeng wants to merge 4 commits intoapache:mainfrom
zhengruifeng:doc_first_last
Open

GH-49269: [Python][Docs] Add code examples for compute function first/last/first_last#49270
zhengruifeng wants to merge 4 commits intoapache:mainfrom
zhengruifeng:doc_first_last

Conversation

@zhengruifeng
Copy link
Contributor

@zhengruifeng zhengruifeng commented Feb 13, 2026

Rationale for this change

To improve python documentation

What changes are included in this PR?

Add code examples for compute function first/last/first_last

Are these changes tested?

Yes, doc-test

Are there any user-facing changes?

Yes, doc-only changes

@github-actions
Copy link

⚠️ GitHub issue #49269 has been automatically assigned in GitHub to PR creator.

@zhengruifeng
Copy link
Contributor Author

@github-actions crossbow submit preview-docs

@github-actions
Copy link

Revision: 2491b6b

Submitted crossbow builds: ursacomputing/crossbow @ actions-f89059f9d7

Task Status
preview-docs GitHub Actions

>>> pc.first_last(arr3, options=pc.ScalarAggregateOptions(min_count=4))
<pyarrow.StructScalar: [('first', None), ('last', None)]>

See Also
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Feb 13, 2026
@zhengruifeng
Copy link
Contributor Author

@AlenkaF @kou would you mind taking a look? thanks

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1


Using ``skip_nulls`` to handle null values.

>>> arr2 = pa.array([1.0, 2.0, 3.0, None])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using None as the first element?

Suggested change
>>> arr2 = pa.array([1.0, 2.0, 3.0, None])
>>> arr2 = pa.array([None, 2.0, 3.0, None])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, let me adjust the examples

@github-actions github-actions bot added awaiting merge Awaiting merge awaiting review Awaiting review awaiting committer review Awaiting committer review and removed awaiting committer review Awaiting committer review awaiting review Awaiting review awaiting merge Awaiting merge labels Feb 27, 2026
@kou
Copy link
Member

kou commented Feb 28, 2026

@github-actions crossbow submit preview-docs

@github-actions
Copy link

Revision: 304af83

Submitted crossbow builds: ursacomputing/crossbow @ actions-29ab51c673

Task Status
preview-docs GitHub Actions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants